import { rule } from "@/util/validateRules";
export const tableOption = {
  dialogClickModal: false,
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  menuWidth: 300,
  searchMenuSpan: 6,
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  viewBtn: true,
  column: [{
    width: 150,
    label: '角色类型',
    prop: 'clientId',
    type: 'radio',
    border: true,
    slot: true,
    editDisabled: true,
    span: 24,
    rules: [
      { required: true, message: '请选择角色类型', trigger: 'blur' }
    ],
    dicData: [{
      label: 'PC端',
      value: 'pcSide'
    }, {
      label: '移动端',
      value: 'mobileSide'
    }],
    search: true,
    searchValue: 'pcSide'
  }, {
    label: '角色名称',
    prop: 'roleName',
    span: 24,
    rules: [
      { required: true, message: '角色名称不能为空', trigger: 'blur' },
      { min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' }
    ],
  }, {
    label: '角色标识',
    prop: 'roleCode',
    span: 24,
    order: 10,
    editDisabled: true,
    rules: [
      { required: true, message: '角色标识不能为空', trigger: 'blur' },
      { min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' },
      { validator: rule.validatorKey, trigger: 'blur' }
    ],
  }, {
    label: '角色描述',
    prop: 'roleDesc',
    overHidden: true,
    type: 'textarea',
    span: 24,
    row: true,
    minRows: 2,
    rules: [
      { max: 128, message: '长度在 128 个字符内', trigger: 'blur' }
    ]
  }, {
    width: 180,
    label: '创建时间',
    prop: 'createTime',
    type: 'datetime',
    format: 'yyyy-MM-dd HH:mm',
    valueFormat: 'timestamp', //https://avuejs.com/form/form-date.html#%E6%97%A5%E6%9C%9F%E6%A0%BC%E5%BC%8F%E5%8C%96
    editDisplay: false,
    addDisplay: false,
    span: 24
  }]
}
